<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title></title>
	<style type="text/css">
		ul {
			padding: 0;
			margin: 0;
		}
		.lis {
			list-style: none;
			width: 80px;
			height: 30px;
			border: 1px solid #333;
			position: relative;
		}
		.lis a{
			display: block;
			line-height: 30px;
			text-align: center;
			text-decoration: none;
			color: #000000;
			background:#F1F1F1 ;
		}
		ul #ul1{
			padding:0;
			margin: 0;
			width: 140px;
			border: 1px solid #333;
			position: absolute;
			top: 30px;
			left: -1px;
			background: #FF9;
			display: none;
		}
		ul ul li{
			text-align: center;
			line-height: 30px;
		}
	</style>
	<script type="text/javascript">
		window.onload = function(){
			var li = document.getElementById('lis');
			var ul = document.getElementById('ul1');
			var a = document.getElementById('link');
			// console.log(li)
			// console.log(ul)
			// console.log(a)
			li.onmouseover = function(){
				ul.style.display = 'block';
				a.style.background = 'yellow';
			}
			li.onmouseout = function(){
				ul.style.display = 'none';
				a.style.background = '#F1F1F1'; 
			}
		}
	</script>
</head>
<body>
	
	<ul>
		<li id="lis" class="lis">
			<a href="#" id="link">标题</a>
			<ul id="ul1">
				<li>内容</li>
				<li>内容</li>
				<li>内容</li>
			</ul>
		</li>
	</ul>
</body>
</html>